home *** CD-ROM | disk | FTP | other *** search
Text File | 2004-10-19 | 39.2 KB | 1,404 lines |
- <HTML>
-
- <head>
- <SCRIPT LANGUAGE="JavaScript">
- <!--
-
- // ...........................................................................
- var virtualTab = " ";
- var miniTab = " ";
- var the_text = "";
- var logArr = new Array(1000);
- var logNdx = 0;
-
- function addToLog(t)
- {
- logArr[logNdx++] = t + "<br>";
- document.all.log.value = t;
-
- //the_text += "~" + t + "\n"; //"\n";
- //document.all.log.value = the_text;
- }
- function announceFinish(t)
- {
- var asterisks = "********";
- var msg = asterisks + " Test completed OK: " + t + " " + asterisks;
- addToLog(msg);
- }
- function announceFinishBad(t,cnt)
- {
- var asterisks = "********";
- var msg = asterisks + " Test completed with " + cnt + " ERRORS: " + t + " " + asterisks;
- addToLog(msg);
- }
- function announceCompletedSubsection()
- {
- var dashes = "-------";
- var msg = miniTab + dashes + " Section completed OK " + dashes;
- addToLog(msg);
- }
- function announceStart(t)
- {
- var asterisks = "********";
- var msg = asterisks + " Starting test: " + t + " " + asterisks;
- addToLog(msg);
- }
- function error(t)
- {
- var asterisks = "********";
- var msg = asterisks + " ERROR: " + t + " " + asterisks;
- addToLog(msg);
- }
- function item(nmbr_tabs, t)
- {
- var msg = "";
-
- while( nmbr_tabs-- ) {
- msg += virtualTab;
- }
- msg += t;
-
- addToLog(msg);
- }
- function milestone(t)
- {
- var dashes = "-------";
- var msg = miniTab + dashes + " section: " + t + " " + dashes;
- addToLog(msg);
- }
- function redMsg(t)
- {
- var asterisks = "********";
- var msg = asterisks + " NOTE: " + t + " " + asterisks;
- addToLog(msg);
- }
- // ...........................................................................
- // ...........................................................................
- // ...........................................................................
- // ...........................................................................
- // ...........................................................................
- // ...........................................................................
- // ...........................................................................
-
- var RATE_fast = 50;
- var RATE_slow = 500;
- var rate = RATE_slow;
- var glob_tempArr;
- var glob_bool_step_ALL = 0;
- var glob_bool_enchilada = 0;
- var glob_searchword_ndx;
- var glob_searchword_errors;
-
- var tbl_nav_pages = new Array(
- "0_0_0_0.html",
- "0_0_0_0.html",
- "1_0_0_0.html",
- "2_0_0_0.html",
- "0_0_0_0.html",
- "search.html",
- "search.html"
- );
- var tbl_test_names = new Array(
- "ALL - the whole enchilada",
- "Page Stepper - Using Help",
- "Page Stepper - Contents",
- "Page Stepper - Index",
- "Page Stepper - All",
- "Search Test - Search Words",
- "Search Test - Stop Words"
- );
- var T_ALL_ALL = 0;
- var T_STP_UH = 1;
- var T_STP_CO = 2;
- var T_STP_NX = 3;
- var T_STP_ALL = 4;
- var T_SEA_WORD = 5;
- var T_SEA_STOP = 6;
-
- var tbl_test_functions = new Array(
- all_all,
- stp_uh,
- stp_co,
- stp_nx,
- stp_all,
- sea_words,
- sea_stop
- );
-
- var TEST_current = 1;
-
- var links_to_process;
- var links_to_process_ndx;
-
- var links_to_process_NAV;
- var links_to_process_NAV_ndx;
- var links_to_process_CH;
- var links_to_process_CH_ndx;
- var links_to_process_LVL1;
- var links_to_process_LVL1_ndx;
- var the_timer;
-
- var scroll_direction_down = 1;
-
- var glob_pause = 0;
- var glob_nextScrollString = "";
- var glob_nextScrollTime = 0;
- var glob_upTechnique = 0; // 0 = scroll, 1 = 'top' link
- var glob_nextFunction = "";
- var glob_mostRecentNavLink;
- //------------------------------------------------------------------
- function announceLinkClick(s)
- {
- s = "" + s;
- item(1,"Clicking link: " + s );
- }
- //------------------------------------------------------------------
- function announceMilestone(m)
- {
- milestone(m);
- }
- //------------------------------------------------------------------
- function announceTest(is_end)
- {
- var msg = tbl_test_names[TEST_current];
-
- if( ! is_end ) {
- announceStart(msg);
- }
- else if( is_end == 1 ) {
- announceFinish(msg);
- }
- else {
- is_end *= -1;
- announceFinishBad(msg, is_end);
- }
- }
- //------------------------------------------------------------------
- function buttonSaysPause()
- {
- if( top.frames[2].document.forms[0].pause.value.indexOf("pause") != -1 ) {
- return true;
- }
- return false;
- }
- //------------------------------------------------------------------
- function buttonSaysStart()
- {
- if( top.frames[2].document.forms[0].start.value.indexOf("start") != -1 ) {
- return true;
- }
- return false;
- }
- //------------------------------------------------------------------
- function clickContentLink(lvl)
- {
- if( lvl == "CH" ) {
- announceLinkClick(top.frames[1].document.links[links_to_process_CH[links_to_process_CH_ndx]].href);
- top.frames[1].document.links[links_to_process_CH[links_to_process_CH_ndx++]].click();
- }
- else {
- announceLinkClick(top.frames[1].document.links[links_to_process_LVL1[links_to_process_LVL1_ndx]].href);
- top.frames[1].document.links[links_to_process_LVL1[links_to_process_LVL1_ndx++]].click();
- }
- }
- //------------------------------------------------------------------
- function clickNavLink()
- {
- announceLinkClick(top.frames[0].document.links[links_to_process_NAV[links_to_process_NAV_ndx]].href);
- glob_mostRecentNavLink = top.frames[0].document.links[links_to_process_NAV[links_to_process_NAV_ndx]];
- top.frames[0].document.links[links_to_process_NAV[links_to_process_NAV_ndx++]].click();
- }
- //------------------------------------------------------------------
- function clickNextLink()
- {
- if( top.frames[1].document.links[0].innerHTML.indexOf(top.NM_next) != -1 ) {
- announceLinkClick(top.frames[1].document.links[0]);
- top.frames[1].document.links[0].click();
- return true;
- }
- else if( top.frames[1].document.links[1].innerHTML.indexOf(top.NM_next) != -1 ) {
- announceLinkClick(top.frames[1].document.links[1]);
- top.frames[1].document.links[1].click();
- return true;
- }
- else {
- return false;
- }
- }
- //------------------------------------------------------------------
- function clickOnLinkThatMatches(node)
- {
- for( var ndx=0; ndx < top.frames[0].document.links.length; ndx++ ) {
- if( getLastNodeOf( "" + top.frames[0].document.links[ndx] ) == node ) {
- announceLinkClick(top.frames[0].document.links[ndx].innerHTML);
- top.frames[0].document.links[ndx].click();
- return 1;
- }
- }
- return 0;
- }
- //------------------------------------------------------------------
- function clickPrevLink()
- {
- if( top.frames[1].document.links[0].innerHTML.indexOf(top.NM_previous) != -1 ) {
- announceLinkClick(top.frames[1].document.links[0]);
- top.frames[1].document.links[0].click();
- return true;
- }
- else if( top.frames[1].document.links[1].innerHTML.indexOf(top.NM_previous) != -1 ) {
- announceLinkClick(top.frames[1].document.links[1]);
- top.frames[1].document.links[1].click();
- return true;
- }
- else {
- return false;
- }
- }
- //------------------------------------------------------------------
- function clickTheTopLink()
- {
- if( top.frames[1].document.links[top.frames[1].document.links.length-1].innerHTML.indexOf(top.NM_top) != -1 ) {
- top.frames[1].document.links[top.frames[1].document.links.length-1].click();
- }
- }
- //------------------------------------------------------------------
- function disableEraseButton()
- {
- top.frames[2].document.forms[0].eraseLog.disabled = true;
- }
- //------------------------------------------------------------------
- function disableWindowizeLogButton()
- {
- top.frames[2].document.forms[0].windowizeLog.disabled = true;
- }
- //------------------------------------------------------------------
- function disablePauseButton()
- {
- top.frames[2].document.forms[0].pause.disabled = true;
- }
- //------------------------------------------------------------------
- function disableStartButton()
- {
- top.frames[2].document.forms[0].start.disabled = true;
- }
- //------------------------------------------------------------------
- function enableEraseButton()
- {
- top.frames[2].document.forms[0].eraseLog.disabled = false;
- }
- //------------------------------------------------------------------
- function enableWindowizeLogButton()
- {
- top.frames[2].document.forms[0].windowizeLog.disabled = false;
- }
- //------------------------------------------------------------------
- function enablePauseButton()
- {
- top.frames[2].document.forms[0].pause.disabled = false;
- }
- //------------------------------------------------------------------
- function enableStartButton()
- {
- top.frames[2].document.forms[0].start.disabled = false;
- }
- //------------------------------------------------------------------
- function endTest(msg,showAlert)
- {
- clearTimeout(the_timer);
- if( ! showAlert ) { return; }
- makeButtonSayPause();
- disablePauseButton();
- makeButtonSayStart();
- enableStartButton();
- enableEraseButton();
- enableWindowizeLogButton();
- scrollPupEnable();
- testSelPupEnable();
- alert(msg);
- }
- //------------------------------------------------------------------
- function eraseTheLog()
- {
- if( confirm("Do you really want to erase the entire log?") ) {
- document.all.log.value = "";
- logArr = new Array(1000);
- //the_text = "";
- }
- }
- //------------------------------------------------------------------
- function gatherListOfLevel_1_Links() // links that reside within chapters but link to L1 items
- {
- var here = getLastNodeOf( "" + top.frames[1].document.location );
- var beginning = getBeginningOf(here,2);
-
- glob_tempArr = new Array();
-
- links_to_process_CH = new Array();
- links_to_process_CH_ndx = 0;
-
- for( var ndx=1; ndx < top.frames[1].document.links.length; ndx++ ) {
- var lnk = "" + top.frames[1].document.links[ndx];
- var normalized = getLastNodeOf( lnk );
-
- if( (normalized.indexOf("0.html") != 0) &&
- (normalized.indexOf(beginning) == 0) &&
- (normalized.indexOf("top") == -1)
- ) {
- // We have a candidate link. Make sure that it already isn't in the list of links to process
- if( ! inArray(normalized) ) {
- glob_tempArr[glob_tempArr.length] = normalized;
- links_to_process_CH[links_to_process_CH.length] = ndx;
- }
- }
- }
- return links_to_process_CH.length;
- }
- //------------------------------------------------------------------
- function gatherListOfLevel_2_Links()
- {
- var here = getLastNodeOf( "" + top.frames[1].document.location );
- var beginning = getBeginningOf(here,3);
-
- glob_tempArr = new Array();
-
- links_to_process_LVL1 = new Array();
- links_to_process_LVL1_ndx = 0;
-
- for( var ndx=1; ndx < top.frames[1].document.links.length; ndx++ ) {
- var lnk = "" + top.frames[1].document.links[ndx];
- var normalized = getLastNodeOf( lnk );
-
- if( (normalized.indexOf("0.html") == -1) &&
- (normalized.indexOf(beginning) == 0) &&
- (normalized.indexOf("top") == -1)
- ) {
- // We have a candidate link. Make sure that it already isn't in the list of links to process
- if( ! inArray(normalized) ) {
- glob_tempArr[glob_tempArr.length] = normalized;
- links_to_process_LVL1[links_to_process_LVL1.length] = ndx;
- }
- }
- }
- return links_to_process_LVL1.length;
- }
- //------------------------------------------------------------------
- function gatherListOfNavLinks(s)
- {
- var ptn = "/" + s + "_";
-
- links_to_process_NAV = new Array();
- links_to_process_NAV_ndx = 0;
- for( var ndx=0; ndx < top.frames[0].document.links.length; ndx++ ) {
- var lnk = "" + top.frames[0].document.links[ndx];
- if( lnk.lastIndexOf(ptn) != -1 ) {
- links_to_process_NAV[links_to_process_NAV.length] = ndx;
- }
- }
- }
- //------------------------------------------------------------------
- function getAndSetStopword4Search()
- {
- var current_sw = top.stopwords[glob_searchword_ndx++];
-
- top.srch_input_verbatim = current_sw;
- searchTerm = current_sw;
- top.srch_input_massaged = current_sw;
-
- return current_sw;
- }
- //------------------------------------------------------------------
- function getBeginningOf( u, lmt )
- {
- var retStr = "";
- var underscoreCnt = 0;
-
- for( var ndx = 0; ndx < u.length; ndx++ ) {
- if( u.charAt(ndx) == '_' ) {
- retStr += u.charAt(ndx);
- underscoreCnt++;
- if( underscoreCnt == lmt ) {
- return retStr;
- }
- }
- else {
- retStr += u.charAt(ndx);
- }
- }
- return retStr;
- }
- //------------------------------------------------------------------
- function getLastNodeOf( u )
- {
- var pos = u.lastIndexOf("/");
-
- if( pos == -1 ) { return u; }
-
- pos++;
- return u.substring(pos);
- }
- //------------------------------------------------------------------
- function getNextNxNode( n )
- {
- var nextNum;
- var myArr = new Array();
-
- myArr = n.split("_");
- nextNum = parseInt(myArr[1]) + 1;
- myArr[1] = nextNum;
- return "" + myArr[0] + "_" + myArr[1] + "_" + myArr[2] + "_" + myArr[3];
- }
- //------------------------------------------------------------------
- function inArray(v)
- {
- for( var ndx=0; ndx < glob_tempArr.length; ndx++ ) {
- if( glob_tempArr[ndx] == v ) {
- return true;
- }
- }
- return false;
- }
- //------------------------------------------------------------------
- function leftPaneIs(u)
- {
- var leftPaneURL = getLastNodeOf(top.frames[0].document.location);
-
- return (u == leftPaneURL);
- }
- //------------------------------------------------------------------
- function makeButtonSayPause()
- {
- top.frames[2].document.forms[0].pause.value = "pause";
- }
- //------------------------------------------------------------------
- function makeButtonSayResume()
- {
- top.frames[2].document.forms[0].pause.value = "resume";
- }
- //------------------------------------------------------------------
- function makeButtonSayStart()
- {
- top.frames[2].document.forms[0].start.value = "start";
- }
- //------------------------------------------------------------------
- function makeButtonSayStop()
- {
- top.frames[2].document.forms[0].start.value = "stop";
- }
- //------------------------------------------------------------------
- function pauseResumeTest()
- {
- if( glob_pause ) { // do resume
- makeButtonSayPause();
- glob_pause = 0;
- enableStartButton();
- disableEraseButton();
- disableWindowizeLogButton();
- scrollPupDisable();
- }
- else { // do pause
- makeButtonSayResume();
- glob_pause = 1;
- disableStartButton();
- enableEraseButton();
- enableWindowizeLogButton();
- scrollPupEnable();
- }
- }
- //------------------------------------------------------------------
- function proceedToNextFunction(f)
- {
- clearTimeout(the_timer);
- the_timer = setTimeout(f, rate);
- }
- //------------------------------------------------------------------
- function proceedToNextFunctionLong(f)
- {
- clearTimeout(the_timer);
- the_timer = setTimeout(f, rate*3);
- }
- //------------------------------------------------------------------
- function rpt(next,color1,color2)
- {
- var paramStr = "rpt(" + next + "," + color1 + "," + color2 + ")";
-
- if( glob_pause ) { setTimeout(paramStr, 1000); return; }
-
- if( color1 ) {
- item(2,"Content pane URL: " + top.frames[1].document.location);
- }
- else {
- item(2,"Content pane URL: " + top.frames[1].document.location);
- }
-
- if( color2 ) {
- item(2,"Content pane TITLE: " + top.frames[1].document.title);
- }
- else {
- item(2,"Content pane TITLE: " + top.frames[1].document.title);
- }
-
- // Prepare for the next phase
- the_timer = setTimeout(next, rate);
- }
- //------------------------------------------------------------------
- function rptLeft(next,color1,color2)
- {
- var paramStr = "rpt(" + next + "," + color1 + "," + color2 + ")";
-
- if( glob_pause ) { setTimeout(paramStr, 1000); return; }
-
- if( color1 >= 0 ) {
- if( color1 ) {
- item(2,"Nav pane URL: " + top.frames[0].document.location);
- }
- else {
- item(2,"Nav pane URL: " + top.frames[0].document.location);
- }
- }
-
- if( color2 >= 0 ) {
- if( color2 ) {
- item(2,"Nav pane TITLE: " + top.frames[0].document.title);
- }
- else {
- item(2,"Nav pane TITLE: " + top.frames[0].document.title);
- }
- }
-
- // Prepare for the next phase
- if( next.length ) {
- the_timer = setTimeout(next, rate);
- }
- }
- //------------------------------------------------------------------
- function scrollPupDisable()
- {
- top.frames[2].document.forms[0].whichScroll.disabled = true;
- }
- //------------------------------------------------------------------
- function scrollPupEnable()
- {
- top.frames[2].document.forms[0].whichScroll.disabled = false;
- }
- //------------------------------------------------------------------
- function testSelPupDisable()
- {
- top.frames[2].document.forms[0].whichTest.disabled = true;
- }
- //------------------------------------------------------------------
- function testSelPupEnable()
- {
- top.frames[2].document.forms[0].whichTest.disabled = false;
- }
- //------------------------------------------------------------------
- function setNavFrame()
- {
- top.frames[0].document.location = tbl_nav_pages[TEST_current];
- }
- //------------------------------------------------------------------
- function startStopTest()
- {
- if( buttonSaysStart() ) { // START the test
- makeButtonSayStop();
- makeButtonSayPause();
- enablePauseButton();
- disableEraseButton();
- disableWindowizeLogButton();
- setNavFrame(); // Just in case the user did a back, etc. on the NAV frame
- scrollPupDisable();
- testSelPupDisable();
- the_timer = setTimeout("tbl_test_functions[TEST_current]()", rate); // <<<<<<<<<<<<<<<< PERFORM TEST
- }
- else { // STOP the test
- makeButtonSayStart();
- redMsg("Test Aborted");
- endTest("Test Aborted",1);
- makeButtonSayPause();
- disablePauseButton();
- enableEraseButton();
- enableWindowizeLogButton();
- scrollPupEnable();
- testSelPupEnable();
- clearTimeout(the_timer);
- glob_bool_step_ALL = 0;
- glob_bool_enchilada = 0;
- }
- glob_upTechnique = 0;
- }
- //------------------------------------------------------------------
- function stepThroughTheLinks()
- {
- if( glob_pause ) { setTimeout("stepThroughTheLinks()", 1000); return; }
-
- if( links_to_process_NAV_ndx < links_to_process_NAV.length ) {
- clickNavLink();
-
- windowScroll("rpt('stepThroughTheLinks()',0,1)",rate,1);
- }
- else {
- proceedToNextFunction(glob_nextFunction+"()");
- }
- }
- //------------------------------------------------------------------
- function testChange(which)
- {
- if( which != TEST_current ) {
- TEST_current = which;
-
- setNavFrame();
- }
- }
- //------------------------------------------------------------------
- function scrollChange(which)
- {
- if( ! which ) {
- rate = RATE_fast;
- }
- else {
- rate = RATE_slow;
- }
- }
- //------------------------------------------------------------------
- function handleSpaces(s)
- {
- var str = "";
- var ndx;
-
- for( ndx = 0; ndx < s.length; ndx++ ) {
- var ch = s.substring(ndx,ndx+1);
- if( ch == " " ) {
- str += " ";
- }
- else {
- str += ch;
- }
- }
-
- return str;
- }
- //------------------------------------------------------------------
- function showLog()
- {
- var logWin = window.open("", "log", "status=yes,scrollbars=yes");
- var logWinRange = logWin.document.body.createTextRange();
-
- var oneLongLineWithBreaks = "", ndx;
-
- for( ndx = 0; ndx < logNdx; ndx++ ) {
- oneLongLineWithBreaks += handleSpaces(logArr[ndx]);
- }
-
- logWinRange.pasteHTML(oneLongLineWithBreaks);
- }
- //------------------------------------------------------------------
- function windowScroll(nextScrollString, nextScrollTime, is_right_side)
- {
- var curPos;
- var scroll = parseInt(top.frames[2].document.forms[0].whichScroll.value);
- var setTimeoutStr = is_right_side ? "windowScroll('',0,1)" : "windowScroll('',0,0)";
- var theFrameToBeScrolled = is_right_side ? top.frames[1] : top.frames[0];
-
- if( nextScrollString.length ) { // Must be first time/init
- scroll_direction_down = 1;
- glob_nextScrollString = nextScrollString;
- glob_nextScrollTime = nextScrollTime;
- clearTimeout(the_timer);
- if( ! scroll ) {
- the_timer = setTimeout(glob_nextScrollString,glob_nextScrollTime);
- }
- else {
- the_timer = setTimeout(setTimeoutStr, rate);
- }
- return;
- }
-
- if( ! scroll ) {
- clearTimeout(the_timer);
- the_timer = setTimeout(glob_nextScrollString,glob_nextScrollTime);
- return;
- }
-
- if( glob_pause ) { setTimeout(setTimeoutStr, 500); return; }
-
- if( theFrameToBeScrolled.document.body.scrollHeight > theFrameToBeScrolled.document.body.clientHeight) {
- // WINDOW IS SCROLLABLE
-
- if( scroll_direction_down ) {
- theFrameToBeScrolled.scrollBy(0,scroll); // <<<------- SCROLL THE WINDOW
- curPos = theFrameToBeScrolled.document.body.scrollTop;
- if(curPos >= theFrameToBeScrolled.document.body.scrollHeight-theFrameToBeScrolled.document.body.clientHeight) {
- scroll_direction_down = 0;
- }
- }
- else {
- if( glob_upTechnique ) { // We need to get back to the top via the 'top' link
- scroll_direction_down = 1;
- clickTheTopLink();
- clearTimeout(the_timer);
- the_timer = setTimeout(glob_nextScrollString,glob_nextScrollTime);
- return;
- }
- theFrameToBeScrolled.scrollBy(0,(scroll * -1)); // <<<------- SCROLL THE WINDOW
- curPos = theFrameToBeScrolled.document.body.scrollTop;
- if( curPos < scroll ) {
- curPos = 0;
- }
- if( ! curPos ) {
- scroll_direction_down = 1;
- theFrameToBeScrolled.scroll(0,0); // <<<------- FORCE WINDOW TO TOP
- clearTimeout(the_timer);
- the_timer = setTimeout(glob_nextScrollString,glob_nextScrollTime);
- return;
- }
- }
- the_timer = setTimeout(setTimeoutStr, 1);
- }
- else {
- // WINDOW IS NOT SCROLLABLE
- theFrameToBeScrolled.scroll(0,0); // <<<------- FORCE WINDOW TO TOP
- clearTimeout(the_timer);
- the_timer = setTimeout(glob_nextScrollString,glob_nextScrollTime);
- }
- }
- //------------------------------------------------------------------
- //------------------------------------------------------------------
- //------------------------------------------------------------------
- //------------------------------------------------------------------
- //------------------------------------------------------------------
- //------------------------------------------------------------------
- //------------------------------------------------------------------
- //------------------------------------------------------------------
- function stp_all()
- {
- glob_bool_step_ALL = 1;
- testChange(T_STP_UH);
- stp_uh();
- }
- //------------------------------------------------------------------
- function stp_uh()
- {
- announceTest(0);
- announceMilestone("Clicking upon the navigation links.");
-
- gatherListOfNavLinks("0");
-
- proceedToNextFunction("stp_uh_navlinks()");
- }
- //------------------------------------------------------------------
- function stp_uh_navlinks()
- {
- if( glob_pause ) { setTimeout("stp_uh_navlinks()", 1000); return; }
-
- if( links_to_process_NAV_ndx < links_to_process_NAV.length ) {
- clickNavLink();
- windowScroll("rpt('stp_uh_navlinks()',0,1)",rate,1);
- }
- else {
- announceCompletedSubsection();
- milestone("Clicking upon the PREVIOUS links.");
- proceedToNextFunction("stp_uh_prevLinks()");
- }
- }
- //------------------------------------------------------------------
- function stp_uh_nextLinks()
- {
- if( glob_pause ) { setTimeout("stp_uh_nextLinks()", 1000); return; }
-
- if( top.frames[1].document.links[0].innerHTML.indexOf(top.NM_next) != -1 ) {
- // This is the first 'Next' link. Click it!
- glob_upTechnique = 1; // Use 'top' link to get up
- announceLinkClick(top.frames[1].document.links[0]);
- top.frames[1].document.links[0].click();
- windowScroll("rpt('stp_uh_nextLinks()',1,0)", rate,1);
- }
- else if( top.frames[1].document.links[1].innerHTML.indexOf(top.NM_next) != -1 ) {
- // This is a non-first 'Next' link. Click it!
- announceLinkClick(top.frames[1].document.links[1]);
- top.frames[1].document.links[1].click();
- windowScroll("rpt('stp_uh_nextLinks()',1,0)", rate,1);
- }
- else {
- announceCompletedSubsection();
- announceTest(1);
- if(glob_bool_step_ALL) {
- endTest("DONE", 0);
- testChange(T_STP_CO);
- proceedToNextFunction("stp_co()");
- }
- else {
- endTest("DONE", 1 );
- }
- }
- }
- //------------------------------------------------------------------
- function stp_uh_prevLinks()
- {
- if( glob_pause ) { setTimeout("stp_uh_prevLinks()", 1000); return; }
-
- if( top.frames[1].document.links[0].innerHTML.indexOf(top.NM_previous) != -1 ) {
- // There is a 'Previous' link. Click it!
- announceLinkClick(top.frames[1].document.links[0]);
- top.frames[1].document.links[0].click();
- windowScroll("rpt('stp_uh_prevLinks()',1,0)", rate,1);
- }
- else {
- announceCompletedSubsection();
- milestone("Clicking upon the NEXT links.");
- proceedToNextFunction("stp_uh_nextLinks()");
- }
- }
- //------------------------------------------------------------------
- function stp_co()
- {
- announceTest(0);
- announceMilestone("Clicking upon the 'contents' links tree.");
-
- gatherListOfNavLinks("1");
-
- proceedToNextFunction("stp_co_links(0)");
- }
- //------------------------------------------------------------------
- function stp_co_links(state)
- {
- if( glob_pause ) { setTimeout("stp_co_links("+state+")", 1000); return; }
-
- // --------------------------------
- // STATE = = click nav-side link
- // --------------------------------
- if( ! state ) {
- if( links_to_process_NAV_ndx < links_to_process_NAV.length ) {
- clickNavLink();
- windowScroll("rpt('stp_co_links(1)',0,1)",rate,1);
- }
- else {
- announceCompletedSubsection();
- stp_co2();
- }
- }
-
- // -------------------------------------
- // STATE = 1 = get list of level 1 links
- // -------------------------------------
- else if( state == 1 ) {
- gatherListOfLevel_1_Links();
- proceedToNextFunction("stp_co_links(2)");
- }
-
- // ------------------------------------------
- // STATE = 2 = click the current level 1 link
- // ------------------------------------------
- else if( state == 2 ) {
- if( links_to_process_CH_ndx < links_to_process_CH.length ) {
- clickContentLink("CH");
- windowScroll("rpt('stp_co_links(4)',0,1)",rate,1);
- }
- else {
- proceedToNextFunction("stp_co_links(0)");
- }
- }
-
- // ----------------------------------------
- // STATE = 3 = hit back button in 'content'
- // ----------------------------------------
- else if( state == 3 ) {
- top.frames[1].history.go(-1);
- proceedToNextFunction("stp_co_links(2)");
- }
-
- // -------------------------------------
- // STATE = 4 = get list of level 2 links
- // -------------------------------------
- else if( state == 4 ) {
- if( gatherListOfLevel_2_Links() ) {
- proceedToNextFunction("stp_co_links(5)");
- }
- else {
- proceedToNextFunction("stp_co_links(3)");
- }
- }
-
- // -----------------------------------------------
- // STATE = 5 = click upon the current level 2 link
- // -----------------------------------------------
- else if( state == 5 ) {
- if( links_to_process_LVL1_ndx < links_to_process_LVL1.length ) {
- clickContentLink("L1");
- windowScroll("rpt('stp_co_links(7)',0,1)",rate,1);
- }
- else {
- proceedToNextFunction("stp_co_links(6)");
- }
- }
-
- // ----------------------------------------
- // STATE = 6 = hit back (from level 1)
- // ----------------------------------------
- else if( state == 6 ) {
- top.frames[1].history.go(-1);
- proceedToNextFunction("stp_co_links(2)");
- }
-
- // -----------------------------------------------
- // STATE = 7 = hit back (from level 2)
- // -----------------------------------------------
- else if( state == 7 ) {
- top.frames[1].history.go(-1);
- proceedToNextFunction("stp_co_links(5)");
- }
- }
- //------------------------------------------------------------------
- function stp_co2()
- {
- announceMilestone("Traversing the 'contents' pages via NEXT and PREVIOUS links.");
- proceedToNextFunction("stp_co2_links(0)");
- }
- //------------------------------------------------------------------
- function stp_co2_links(state)
- {
- if( glob_pause ) { setTimeout("stp_co2_links("+state+")", 1000); return; }
-
- // -----------------------------------------
- // STATE = 0 = click to the 1st content page
- // -----------------------------------------
- if( ! state ) {
- links_to_process_NAV_ndx = 0; // Point to first NAV link
- clickNavLink(); // This will get us to the 1st content page.
- proceedToNextFunction("stp_co2_links(1)");
- }
-
- // ---------------------------------------
- // STATE = 1 = click the current NEXT link
- // ---------------------------------------
- else if( state == 1 ) {
- if( clickNextLink() ) {
- proceedToNextFunction("stp_co2_links(1)");
- }
- else {
- proceedToNextFunction("stp_co2_links(2)");
- }
- }
-
- // -------------------------------------------
- // STATE = 2 = click the current PREVIOUS link
- // -------------------------------------------
- else if( state == 2 ) {
- if( clickPrevLink() ) {
- proceedToNextFunction("stp_co2_links(2)");
- }
- else {
- announceCompletedSubsection();
- announceTest(1);
- if(glob_bool_step_ALL) {
- endTest("DONE", 0);
- testChange(T_STP_NX);
- proceedToNextFunction("stp_nx()");
- }
- else {
- endTest("DONE", 1 );
- }
- }
- }
- }
- //------------------------------------------------------------------
- function stp_nx()
- {
- announceTest(0); //glob_bool_step_ALL = 1; glob_bool_enchilada = 1;
- announceMilestone("Clicking upon the letter links.");
-
- proceedToNextFunction("stp_nx_letterLinks()");
- }
- //------------------------------------------------------------------
- function stp_nx_letterLinks()
- {
- var thisNode, nextNode, foundIt = 0;
-
- if( glob_pause ) { setTimeout("stp_nx_letterLinks()", 1000); return; }
-
- thisNode = getLastNodeOf(""+top.frames[0].document.location);
- nextNode = getNextNxNode(thisNode);
-
- // Find the link that matches the next letter and click upon it.
- if( clickOnLinkThatMatches(nextNode) ) {
- clearTimeout(the_timer);
- windowScroll("rptLeft('stp_nx_letterLinks()',1,0)", rate,0);
- }
- else {
- proceedToNextFunction("stp_nx_letterLinksPreFinal()");
- }
- }
- //------------------------------------------------------------------
- function stp_nx_letterLinksPreFinal()
- {
- var alwaysFirstLink = "2_0_0_0.html";
-
- // Find the link that matches the "always 1st link" and click upon it.
- if( clickOnLinkThatMatches(alwaysFirstLink) ) {
- clearTimeout(the_timer);
- windowScroll("rptLeft('stp_nx_letterLinksFinal()',1,0)", rate,0);
- }
- }
- //------------------------------------------------------------------
- function stp_nx_letterLinksFinal()
- {
- rptLeft('',1,-1);
- announceCompletedSubsection();
- stp_nx_pageLinksPre();
- }
- //------------------------------------------------------------------
- function stp_nx_pageLinksPre()
- {
- announceMilestone("Clicking upon the index pages' content links.");
-
- proceedToNextFunction("stp_nx_pageLinks()");
- }
- //------------------------------------------------------------------
- function stp_nx_pageLinks()
- {
- // GATHER A LIST (ARRAY) OF THE LINKS THAT WILL BE CLICKED UPON
- links_to_process_NAV = new Array();
- links_to_process_NAV_ndx = 0;
- for( var ndx=0; ndx < top.frames[0].document.links.length; ndx++ ) {
- var lnk = "" + top.frames[0].document.links[ndx];
- if( (lnk.lastIndexOf("/1_") != -1) && (lnk.lastIndexOf("/1_0_0_0.html") == -1) ) {
- links_to_process_NAV[links_to_process_NAV.length] = ndx;
- }
- }
-
- // PROCEED TO CLICKING THROUGH THOSE LINKS
- glob_nextFunction = "stp_nx_pageLinks_setup4nextpage";
- proceedToNextFunction("stepThroughTheLinks()");
- }
- //------------------------------------------------------------------
- function stp_nx_pageLinks_setup4nextpage()
- {
- var thisNode, nextNode, foundIt = 0;
-
- thisNode = getLastNodeOf(""+top.frames[0].document.location);
- nextNode = getNextNxNode(thisNode);
-
- // Find the link that matches the next letter and click upon it.
- if( clickOnLinkThatMatches(nextNode) ) {
- clearTimeout(the_timer);
- windowScroll("rptLeft('stp_nx_pageLinks()',1,0)", rate,1);
- }
- else {
- proceedToNextFunction("stp_nx_pageLinksPreFinal()");
- }
- }
- //------------------------------------------------------------------
- function stp_nx_pageLinksPreFinal()
- {
- var alwaysFirstLink = "2_0_0_0.html";
-
- // Find the link that matches the "always 1st link" and click upon it.
- if( clickOnLinkThatMatches(alwaysFirstLink) ) {
- clearTimeout(the_timer);
- windowScroll("rptLeft('stp_nx_pageLinksFinal()',1,0)", rate,1);
- }
- }
- //------------------------------------------------------------------
- function stp_nx_pageLinksFinal()
- {
- announceCompletedSubsection();
- announceTest(1);
- if( glob_bool_step_ALL ) {
- if( glob_bool_enchilada ) {
- endTest("DONE with STEPPER-ALL test", 0 );
- testChange(T_SEA_WORD);
- proceedToNextFunction("sea_words()");
- }
- else {
- endTest("DONE with STEPPER-ALL test", 1 );
- }
- }
- else {
- endTest("DONE", 1 );
- }
- }
- //------------------------------------------------------------------
- function all_all()
- {
- glob_bool_enchilada = 1;
- stp_all();
- }
- //------------------------------------------------------------------
- function sea_words()
- {
- announceTest(0);
- //setNavFrame();
- proceedToNextFunction("sea_words_steps(0)");
- }
- //------------------------------------------------------------------
- function sea_words_steps(state)
- {
- var currentLine = "";
- var fileSearched = "";
- var bool_found_it = 0;
-
- if( glob_pause ) { setTimeout("sea_words_steps("+state+")", 1000); return; }
-
- // ----------------
- // STATE = 0 = init
- // ----------------
- if( ! state ) {
- glob_searchword_ndx = 0;
- glob_searchword_errors = 0;
-
- //setNavFrame();
- if( top.sc1.length ) {
- // Search db has been loaded
- rate = RATE_slow;
- proceedToNextFunction("sea_words_steps(2)");
- }
- else {
- // Search db HAS NOT been loaded
- proceedToNextFunction("sea_words_steps(1)");
- }
- }
-
- // -------------------------------------------
- // STATE = 1 = load the database
- // -------------------------------------------
- if( state == 1 ) {
-
- currentLine = "adobe";
- top.srch_input_verbatim = currentLine;
- searchTerm = currentLine;
- top.srch_input_massaged = currentLine;
-
- top.srch_1_shot = 1;
- top.frames[0].location = "srch_fset.html";
-
- rate = RATE_slow * 3;
- proceedToNextFunction("sea_words_steps(2)");
- }
-
- // -------------------------------------------
- // STATE = 2 = search for the current word/file/line
- // -------------------------------------------
- if( state == 2 ) {
- rate = RATE_slow * 2;
- top.frames[0].location = "search.html";
- currentLine = top.sc2[glob_searchword_ndx];
- fileSearched = top.fileArr[glob_searchword_ndx] + ".html";
-
- // Set the maxlength of the input textfield to the length of the current line
- top.frames[0].search.input.maxLength = currentLine.length;
- // Enter the current stopword into the input textfield
- top.frames[0].document.forms["search"].input.value = currentLine;
- // Click upon the 'Search' button
- top.frames[0].document.forms["search"].doSearch.click();
-
- item(1,"Searching for file contents: " + fileSearched );
- proceedToNextFunction("sea_words_steps(3)");
- }
-
- // -------------------------------------------
- // STATE = 3 = report search results
- // -------------------------------------------
- if( state == 3 ) {
-
- if( top.frames[0].document.links.length <= 4 ) { // checking for any besides UH, CO, NX, SM
- item(2,"ERROR: No search hits were found!");
- glob_searchword_errors++;
- }
- else {
- bool_found_it = 0;
- currentLine = top.sc2[glob_searchword_ndx];
- fileSearched = top.fileArr[glob_searchword_ndx] + ".html";
-
- for( var ndx = 0; ndx < top.frames[0].document.links.length; ndx++ ) {
- var lnk = "" + top.frames[0].document.links[ndx];
- var href = "" + top.frames[0].document.links[ndx].href;
- href = href.substring(href.lastIndexOf("/")+1,href.length);
-
- if( lnk.indexOf(fileSearched) != -1 ) {
- bool_found_it = 1;
- item(2,"FOUND link to: " + href);
- }
- } // end of 'for' loop
- if( ! bool_found_it ) {
- item(2,"ERROR: This file's contents were NOT FOUND!");
- glob_searchword_errors++;
- proceedToNextFunction("sea_words_steps(4)");
- }
- glob_searchword_ndx++;
- if( glob_searchword_ndx >= top.sc2.length ) {
- // DONE
- proceedToNextFunction("sea_words_steps(4)");
- }
- else {
- // NOT DONE
- proceedToNextFunction("sea_words_steps(2)");
- }
- }
- }
-
- // -------------------------------------------
- // STATE = 4 = DONE = wrap it up!
- // -------------------------------------------
- if( state == 4 ) {
- if( ! glob_searchword_errors ) {
- announceTest(1);
- }
- else {
- announceTest( -1 * glob_searchword_errors );
- }
- if( glob_bool_enchilada ) {
- endTest("DONE with SEARCH-words test", 0 );
- if( top.isDblByte ) {
- endTest("DONE with THE WHOLE ENCHILADA test", 1 );
- }
- else {
- testChange(T_SEA_STOP);
- sea_stop();
- }
- }
- else {
- endTest("DONE",1);
- }
- }
- }
- //------------------------------------------------------------------
- function sea_stop()
- {
- announceTest(0);
- proceedToNextFunction("sea_stop_steps(0)");
- }
- //------------------------------------------------------------------
- function sea_stop_steps(state)
- {
- var current_sw;
-
- if( glob_pause ) { setTimeout("sea_stop_steps("+state+")", 1000); return; }
-
- // ----------------
- // STATE = 0 = init
- // ----------------
- if( ! state ) {
- glob_searchword_ndx = 0;
- glob_searchword_errors = 0;
- rate = RATE_slow * 3;
- setNavFrame();
- proceedToNextFunction("sea_stop_steps(1)");
- }
-
- // -------------------------------------------
- // STATE = 1 = search for the 1st stopword
- // -------------------------------------------
- if( state == 1 ) {
-
- current_sw = getAndSetStopword4Search();
-
- top.srch_1_shot = 1;
-
- item(1,"Searching for stopword: " + current_sw );
- top.frames[0].location = "srch_fset.html";
-
- proceedToNextFunction("sea_stop_steps(2)");
- }
-
- // -------------------------------------------
- // STATE = 2 = report search results
- // -------------------------------------------
- if( state == 2 ) {
- if( top.frames[0].document.links.length > 4 ) { // checking for any besides UH, CO, NX, SM
- item(2,"ERROR: This stopword yielded search hits!");
- glob_searchword_errors++;
- }
- else {
- item(2, "OK: no search hits were found" );
- }
- if( glob_searchword_ndx >= top.stopwords.length ) {
- // We are done. We have processed all of the stopwords.
- proceedToNextFunction("sea_stop_steps(4)");
- }
- else {
- // We are not yet done.
- rate = RATE_slow;
- proceedToNextFunction("sea_stop_steps(3)");
- }
- }
-
- // -------------------------------------------
- // STATE = 3 = search for non-1st stopword
- // -------------------------------------------
- if( state == 3 ) {
- current_sw = top.stopwords[glob_searchword_ndx++];
-
- // Enter the current stopword into the input textfield
- top.frames[0].document.forms["search"].input.value = current_sw;
- // Click upon the 'Search' button
- top.frames[0].document.forms["search"].doSearch.click();
-
- item(1,"Searching for stopword: " + current_sw );
-
- proceedToNextFunction("sea_stop_steps(2)");
- }
-
- // -------------------------------------------
- // STATE = 4 = DONE = wrap it up!
- // -------------------------------------------
- if( state == 4 ) {
- if( ! glob_searchword_errors ) {
- announceTest(1);
- }
- else {
- announceTest( -1 * glob_searchword_errors );
- }
-
- if( glob_bool_enchilada ) {
- endTest("DONE with THE WHOLE ENCHILADA test", 1 );
- }
- else {
- endTest("DONE",1);
- }
- }
- }
- //------------------------------------------------------------------
- //-->
- </SCRIPT>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- </head>
- <BODY BGCOLOR="#FFFFFF">
-
- <TABLE width="100%">
- <TR>
- <TD valign="top">
- <FORM NAME="the_controls" METHOD=POST ACTION="">
- <SELECT NAME="whichTest" onChange="testChange(this.selectedIndex);">
- <OPTION VALUE="ALL_ALL">Run ALL Tests (The whole enchilada)
- <OPTION VALUE="PAGE_STEPPER_UH" selected>Page Stepper - UH
- <OPTION VALUE="PAGE_STEPPER_CO">Page Stepper - CO
- <OPTION VALUE="PAGE_STEPPER_NX">Page Stepper - NX
- <OPTION VALUE="PAGE_STEPPER_ALL">Page Stepper - ALL
- <OPTION VALUE="SEARCH_TESTER_WORD">Search Tester - Search Words
- <OPTION VALUE="SEARCH_TESTER_STOP">Search Tester - Stop Words
- </SELECT>
-
- <SELECT NAME="whichScroll" onChange="scrollChange(this.selectedIndex);">
- <OPTION VALUE="0" selected>No scrolling
- <OPTION VALUE="2">Slow scrolling
- <OPTION VALUE="5">Medium scrolling
- <OPTION VALUE="8">Fast scrolling
- </SELECT>
-
- <INPUT TYPE="button" ID="pause" VALUE="pause" onClick="pauseResumeTest();" disabled>
- <INPUT TYPE="button" ID="start" VALUE="start" onClick="startStopTest();">
- <INPUT TYPE="button" ID="eraseLog" VALUE="erase log" onClick="eraseTheLog();">
- <INPUT TYPE="button" ID="windowizeLog" VALUE="display log" onClick="showLog();">
- </FORM>
- </TD>
- </TR>
- <TR>
- <TD valign="top">
- <FORM NAME="logForm" METHOD=POST ACTION="">
- Current Log Line:<br>
- <INPUT TYPE="text" NAME="log" size="60" maxlength="60">
- </FORM>
- </TD>
- </TR>
- </TABLE>
-
- </BODY>
- </html>